#include "SeqQueue.cpp"

class Person {
public:
    string name;
    int age;

    Person(const string &name, int age) : name(name), age(age) {}

    friend ostream &operator<<(ostream &os, const Person &person) {
        os << "name: " << person.name << " age: " << person.age;
        return os;
    }
};

int main() {
    //创建队列
    SeqQueue<Person>* queue = new SeqQueue<Person>();
    //创建数据
    Person p1("aaa",18);
    Person p2("bbb",19);
    Person p3("ccc",20);
    Person p4("ddd",21);
    Person p5("eee",22);

    queue->Push_SeqQueue(&p1);
    queue->Push_SeqQueue(&p2);
    queue->Push_SeqQueue(&p3);
    queue->Push_SeqQueue(&p4);
    queue->Push_SeqQueue(&p5);


    //输出队尾元素
    Person* backP = queue->Back_SeqQueue();
    cout<<*backP<<endl;
    cout<<"========================"<<endl;

    while (queue->Size_SeqQueue() > 0) {
        //取出队头元素
        Person* p = queue->Pop_SeqQueue();;
        cout<<*p<<endl;
    }

    delete(queue);
    return 0;
}